﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="rqJoin.aspx.vb" Inherits="ExpWeb.rqJoin" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register Src="~/User_Control/ucUnitView.ascx" TagPrefix="uc1" TagName="ucUnitView" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
     <script language='javascript' type="text/javascript">

         function checknum1(fldobj, id) {
             var numberObject = id.replace("MainContentPlaceHolder_grdView0_lblGetPointView0_", "")
             var lblGetPointView0 = document.getElementById("MainContentPlaceHolder_grdView0_lblGetPointView0_" + numberObject); 
             var lblPointPerNightView0 = document.getElementById("MainContent_lblPointPerNightView0_" + numberObject);

             fldobj.value = fldobj.value.replace(/\s/g, "");   //Replace space
             if (isNaN(fldobj.value)) {
                 alert('Number 0-365 only !');
                 fldobj.value = '';
                 lblGetPointView0.value = '';
                 return false;
             }
      
            
             if (fldobj.value == '') {
                lblGetPointView0.value = '';
                 return false;
             }

             //lblGetPointView0.innerText = fldobj.value * lblPointPerNightView0.value; //parseFloat(fldobj.value).toFixed(DecimalNumber.value)

             //alert(lblGetPointView0.innerText);
             //return true;
         }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="row">
        <div class="col-md-2">
            <h3>Request Join</h3>
        </div>
        <div class="col-md-10">
            <asp:Label ID="lblStatus" runat="server" Width="131px"></asp:Label>
        </div>
    </div>

    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="view0" runat="server">

            <div class="col-lg-6 col-lg-offset-3">
                <div class="row">
                    <div class="col-sm-6 col-md-6 col-lg-6">
                        <div class="form-group">
                            <label>Requestor :</label>
                            <asp:Label ID="lblRequestorView0" runat="server" ></asp:Label>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6 col-lg-6">
                        <div class="form-group">
                            <label>Point Balance :</label>
                            <asp:Label ID="lblPointBalanceView0" runat="server" ></asp:Label>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6 col-lg-6">
                        <div class="form-group has-feedback">
                            
                            <label>Join Date :</label>
                            <asp:Label ID="lblJoinDateView0" runat="server" ></asp:Label>
                               <asp:TextBox ID="txtJoin_DTView0" runat="server" CssClass="form-control" ></asp:TextBox>
                                <span class="glyphicon glyphicon-calendar form-control-feedback" aria-hidden="true"></span>
                               <ajax:CalendarExtender ID="cldJoin_DTView0" Enabled="false" runat="server" TargetControlID="txtJoin_DTView0" Format="dd/MM/yyyy"></ajax:CalendarExtender>

                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6 col-lg-6">
                        <div class="form-group">
                            <label>Expire Date :</label>
                            <asp:Label ID="lblExpireDateView0" runat="server" ></asp:Label>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6 col-lg-6">
                        <div class="form-group">
                            
                            <label>Status :</label>
                            <asp:Label ID="lblStatusView0" runat="server" ></asp:Label>
                             
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6 col-lg-6">
                        <div class="form-group">

                        </div>
                    </div>
                </div>
            </div>

            <div class="row" style="margin-bottom: 5px;">
                <div class="col-lg-12 text-right">
                    <%--<asp:LinkButton ID="ingAddView0" runat="server" CssClass="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Add</asp:LinkButton>--%>
                </div>
            </div>

            <div class="row">
                <div class="col-lg-12">
                    <asp:GridView ID="grdView0" runat="server" DataKeyNames="Unit_ID" Width="100%" AutoGenerateColumns="False" CssClass="table table-hover" GridLines="None">
                         <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#6B696B"></HeaderStyle>
                          <Columns>
                              <asp:TemplateField HeaderText="" Visible="false">
                                <HeaderTemplate>
                                    <center>Update Pool units</center>
                                </HeaderTemplate>
                                <ItemStyle Width="26px" VerticalAlign="top" HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ToolTip="More Detail" CommandName="Edit" CommandArgument='<%#Eval("unit_ID")%>' ID="btnEdit">
                                <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="">
                                <HeaderTemplate>
                                    <center></center>
                                </HeaderTemplate>
                                <ItemStyle Width="26px" VerticalAlign="top" HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ToolTip="More Detail" CommandName="detail" CommandArgument='<%#Eval("unit_ID")%>' ID="btnDetail">
                                <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Resort Name</center>
                                </HeaderTemplate>
                                <ItemStyle Width="20%" VerticalAlign="top" HorizontalAlign="Left" />
                                <ItemTemplate><%# Eval("ResortName")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Unit Number</center>
                                </HeaderTemplate>
                                <ItemStyle Width="10%" VerticalAlign="top" HorizontalAlign="Left" />
                                 <ItemTemplate><%# Eval("UnitName")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Currency</center>
                                </HeaderTemplate>
                                <ItemStyle Width="8%" VerticalAlign="top" HorizontalAlign="left" />
                                <ItemTemplate><%# Eval("Currency_Code")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Rate (/Night)</center>
                                </HeaderTemplate>
                                <ItemStyle Width="8%" VerticalAlign="top" HorizontalAlign="left" />
                                 <ItemTemplate><%# CInt(Eval("RatePrice")).ToString("#,###")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Pool Point</center>
                                </HeaderTemplate>
                                <ItemStyle Width="10%" VerticalAlign="top" HorizontalAlign="center" />
                                 <ItemTemplate><asp:Label ID="lblPointPerNightView0" Text='<%# CInt(Eval("PointPerNight")).ToString("#,###")%>' runat="server" ></asp:Label>

                                     <asp:Label ID="lblUnit_ID" Text='<%# Eval("Unit_ID")%>' Visible="false" runat="server" ></asp:Label>
                                 </ItemTemplate>

                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Quota</center>
                                </HeaderTemplate>
                                <ItemStyle Width="10%" VerticalAlign="top" HorizontalAlign="center" />
                                <ItemTemplate>
                                    <%# Eval("Quota")%>
                                    <asp:TextBox ID="txtQouta" onKeyUp="checknum1(this,this.id)" Visible="false"  Enabled="false"  Style="text-align: right;" Width="60px" Text='<%# Eval("Quota")%>' runat="server"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Get Point</center>
                                </HeaderTemplate>
                                <ItemStyle Width="10%" VerticalAlign="top" HorizontalAlign="center" />
                                <ItemTemplate>
                                      <asp:Label ID="lblGetPointView0" runat="server" ></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Country</center>
                                </HeaderTemplate>
                                <ItemStyle Width="12%" VerticalAlign="top" HorizontalAlign="center" />
                                    <ItemTemplate><%# Eval("CountryName")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField Visible="false">
                                <HeaderTemplate>
                                    <center>Status</center>
                                </HeaderTemplate>
                                <ItemStyle Width="10%" VerticalAlign="top" HorizontalAlign="left" />
                                <ItemTemplate>
                                    <center><%# IIf(Eval("isActive") = True, "Active", "Inactive")%></center>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>
                <div class="col-lg-6 col-lg-offset-3 text-center">
                     <asp:Button ID="btnCalView0" Visible="false" runat="server" Text="Calculate Points" CssClass="btn btn-default" /> &nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnReqJoin" runat="server" Text="Send Request" CssClass="btn btn-default" OnClientClick="return confirm('Make sure, Send Request for join Exchange Program ?');" />
                </div> 
                
            </div>
        </asp:View>

        <asp:View ID="view1" runat="server">
                 
              <div class="col-lg-12">
             
                  <table border="0">
                      <tr><td align="center">
                  <asp:Panel ID="pnlSavebackView1" Visible="false" runat="server" Width="100%" >
                           <asp:Button ID="btnSaveView1" runat="server" Text="SAVE" CssClass="btn btn-default" />&nbsp;
                    <asp:Button ID="btnBackView1" runat="server" Text="Back" CssClass="btn btn-default" />
                  </asp:Panel>
                           </td></tr>
                      <tr><td>
                                <uc1:ucUnitView runat="server" ID="ucUnitView1"  />
                          </td></tr>
                    <tr><td align="center">
             
                             <asp:Button ID="btnSave1View1" runat="server" Text="SAVE" CssClass="btn btn-default" />&nbsp;
                             <asp:Button ID="btnBack1View1" runat="server" Text="Back" CssClass="btn btn-default" />
                     
    
                          </td  ></tr>

                  </table>

                    
                  </div> 
            <br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br /><br /><br />
        </asp:View>
        <asp:View ID="view2" runat="server">
                <div class="col-lg-6 col-lg-offset-3" style="margin-bottom:50px;">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <asp:Label ID="lblPanelHeader" runat="server" Text="Add/Edit Resort"></asp:Label>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Owner Name :</label>
                                    <asp:DropDownList ID="ddl_User" runat="server" CssClass="form-control"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Brand :</label>
                                    <asp:DropDownList ID="ddl_Brand" runat="server" CssClass="form-control" AutoPostBack="True"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Resort :</label>
                                    <asp:DropDownList ID="ddl_Resort" runat="server" CssClass="form-control" AutoPostBack="True">
                                        <asp:ListItem Value="1">Active</asp:ListItem>
                                        <asp:ListItem Value="0">InActive</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Unit Number :</label>
                                    <asp:DropDownList ID="ddl_Unit" runat="server" CssClass="form-control" AutoPostBack="True">
                                    </asp:DropDownList>
                                    </div>
                            </div>
                            <div class="col-lg-12">
                                <div class="form-group">
                                    <label>Quota :</label>
                                    <asp:TextBox ID="txtQuota" runat="server" CssClass="form-control" MaxLength="3"></asp:TextBox>
                                    <label>
                                    Night</label><br />
                                </div>
                            </div>

                            <div class="col-lg-3">
                            </div>

                            <div class="col-lg-3">
                            </div>

                            
                        </div><asp:HiddenField ID="HDFieldUserID" runat="server" />
                        <asp:HiddenField ID="HDFieldUnitID" runat="server" />
                    </div>
                    <div class="panel-footer">
                        <asp:Button ID="btn_Save" runat="server" Text="SAVE" CssClass="btn btn-default" />&nbsp;
                        <asp:Button ID="btn_Cancel" runat="server" CommandArgument="View1" CommandName="SwitchViewByID" Text="Cancel" CssClass="btn btn-default" />
                    </div>
                </div>
            </div>
        </asp:View>
    </asp:MultiView>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script type="text/javascript">
        ActiveMenuIndex(0);
    </script>
</asp:Content>